//
//  VERemondCommentTableViewCell.m
//  VEMoneyPorject
//
//  Created by BlueWind on 2018/9/10.
//  Copyright © 2018年 陈建. All rights reserved.
//

#import "VERemondCommentTableViewCell.h"

@implementation VERemondCommentTableViewCell

{
    UILabel *_commentLabel;
}

/** 返回循环利用的cell */
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    if (self= [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        [self loadDefaultSetting];
    }
    return self;
}

/** 加载默认UI元素和需要的数据 */
- (void)loadDefaultSetting {
    
    _commentLabel = [UILabel new];
    [self.contentView addSubview:_commentLabel];
    [_commentLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.mas_equalTo(UIEdgeInsetsMake(GAP8/2, GAP15, 0, GAP15));
    }];
    _commentLabel.text = @"buleWind回复了UZI:我 ask电话卡讲述了肯德基发送到";
    _commentLabel.textColor = [UIColor colorWithHexString:kDetailTextGrayBlackColor];
    _commentLabel.font = kFont(14);
    
    _commentLabel.attributedText = [BHJProjectHelper ls_changeCorlorWithColor:kCommonRedColor TotalString:_commentLabel.text SubStringArray:@[@"buleWind",@"UZI"]];
    _commentLabel.numberOfLines = 0;
    
    
}

- (void)setComment:(NSString *)comment {
    _comment = comment;
    
    
    NSArray *arr = [comment componentsSeparatedByString:@":"];
    
    _commentLabel.attributedText = [BHJProjectHelper ls_changeCorlorWithColor:kCommonRedColor TotalString:comment SubStringArray:@[arr[0]]];
    _commentLabel.numberOfLines = 0;
}


@end
